﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NTQOnlineExam.Services.Models
{
    public class TermDTO
    {
        public int TermId { get; set; }
        public string TermName { get; set; }
        public string Description { get; set; }
        public decimal? Price { get; set; }
        public int? YearId { get; set; }
        public bool IsPublished { get; set; }
        public bool IsPaid { get; set; }
        public bool IsExpired { get { return ExpiredDate != DateTime.MinValue && ExpiredDate.Date < DateTime.Now.Date; } }
        public DateTime ExpiredDate { get; set; }

        public int? ExpiryDays
        {
            get
            {
                if (ExpiredDate == DateTime.MinValue) return null;
                return ExpiredDate  .Subtract(DateTime.Now.Date).Days;
            }
        }
    }
}
